Tooltip: Avoid redundant variable initialisations
authorDaniel Boles <dboles@src.gnome.org>
Mon, 20 Mar 2017 21:04:49 +0000 (21:04 +0000)
committerDaniel Boles <dboles@src.gnome.org>
Mon, 20 Mar 2017 21:13:50 +0000 (21:13 +0000)
has_tooltip_widget was assigned twice in immediate succession.

return_value is not used anywhere else in this function since commit
14a864c8b55dfe92f8957499f12a3f9303188a12 and does not need a default
value anymore, so move it to the inner scope and don't init to NULL.

gtk/gtktooltip.c

index 563a95e5840cb8321b49bfac43388b0fa46b7168..ea4bf310b2eae533ecad147a4a3915cc92aa2c02 100644 (file)
@@ -1388,8 +1388,7 @@ static void
 gtk_tooltip_handle_event_internal (GdkEvent *event)
 {
   gint x, y;
-  gboolean return_value = FALSE;
-  GtkWidget *has_tooltip_widget = NULL;
+  GtkWidget *has_tooltip_widget;
   GdkDisplay *display;
   GtkTooltip *current_tooltip;
 
@@ -1405,6 +1404,8 @@ gtk_tooltip_handle_event_internal (GdkEvent *event)
 
   if (current_tooltip && current_tooltip->keyboard_mode_enabled)
     {
+      gboolean return_value;
+
       has_tooltip_widget = current_tooltip->keyboard_widget;
       if (!has_tooltip_widget)
        return;